// ===================================
// <copyright>
// This file is part of LABSMFController.
//
//    LABSMFController is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    LABSMFController is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with LABSMFController.  If not, see <http://www.gnu.org/licenses/>.
//    Copyright 2011 David Bakker
//
//</copyright>
// <author>David Bakker</author>
// <email>mailto:DavidFBakker@gmail.com</email>
// <created>Saturday, May 07, 2011</created>
// <lastedit>Saturday, May 07, 2011</lastedit>
// ===================================

using LABSMFController.LABS.Services;

namespace LABSMFController.LABS.Devices
{
   
    #region Nested type: TempProbe

    public class TempProbe
    {
        // public byte[] ByteAddress = new byte[8];
        private int _temperature;

        public TempProbe()
        {
            Header = "Location,LocationID,Description,Temperature,TemperatureHigh,TemperatureLow,MAXProbes";
            TemperatureLow = 10000;
            TemperatureHigh = 0;
        }

        public string Location { get; set; }
        public int LocationID { get; set; }
        public string Description { get; set; }
        public string Header { get; set; }

        public int Temperature
        {
            get { return _temperature; }
            internal set
            {
                if (value < TemperatureLow)
                    TemperatureLow = value;
                if (value > TemperatureHigh)
                    TemperatureHigh = value;

                _temperature = value;
            }
        }

        public int TemperatureLow { get; private set; }
        public int TemperatureHigh { get; private set; }

        public void ResetLevels()
        {
            TemperatureLow = 10000;
            TemperatureHigh = 0;
        }

        public string GetClientOutPut()
        {
            string ret = Location + "," + LocationID + "," + Description + "," + Temperature + "," + TemperatureHigh +
                         "," + TemperatureLow + "," + TemperatureServiceClass.MAXProbes + ";";
            return ret;
        }
    }

    #endregion
}